package 注解;

/**
 * @author:谢君臣
 * @Date:2021/8/8-20:02
 * @version:1.0
 * @function:
 */
public class TestInterface {
    public static void main(String[] args) throws Exception {
        test();
    }

    @Myinterface(value = "张三")
    public static void test() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        // 通过反射获取注解值
        ClassLoader classLoader = TestInterface.class.getClassLoader();
        Class<?> aClass = classLoader.loadClass("基础.注解.Myinterface");
        System.out.println(aClass.getName());
        Object instance = aClass.newInstance();
        System.out.println("asdf");
    }
}
